﻿

@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/content/faIconStyle/IconLayout.css" rel="stylesheet" />

@using Microsoft.AspNetCore.Mvc.Localization
@inject IHtmlLocalizer<SharedResources> SharedLocalizer

<div id="appModel">
    <div  style="width:18%;float:left; height:90%;overflow:auto;">
        <div style="height:10px;"></div>
        <ul id="menuTree" class="ztree"></ul>

    </div>
    <div style="width:2%;float:left;"></div>
    <div style="width:80%;float:right;">


        <!--单行条件-->
        <div class="panel panel-default">
            <div class="panel-heading">查询条件</div>
            <div class="panel-body">
                <div class="input-group">
                    <input id="txt_keyword" type="text" class="form-control" placeholder="@SharedLocalizer["KeyPlaceHolder"]" style="width: 260px;" v-model="queryKey">
                    <span class="input-group-btn">
                        <button id="btn_search" type="button" class="btn  btn-primary-blue" v-on:click="search"><i class="fa fa-search"></i>查询</button>

                    </span>


                </div>
            </div>

        </div>

        <div id="toolbar">
            <div class="btn-group">
                @*<a class="btn btn-default" onclick="$dh.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
                <button class="btn btn-default" v-bind:disabled="!selectedData" v-on:click="edit"><i class="fa fa-pencil-square-o"></i>@SharedLocalizer["Update"]</button>
                <button class="btn btn-default" v-bind:disabled="!selectedData" v-on:click="del"><i class="fa fa-trash-o"></i>@SharedLocalizer["Delete"]</button>
                <button class="btn btn-default" v-on:click="add"><i class="fa fa-plus"></i>@SharedLocalizer["Add"]</button>*@
                @await Html.PartialAsync("_Partical_Button")
            </div>

        </div>

        <div class="table-responsive" style="width:100%">
            <table class="table table-no-bordered " id="tb_menus"></table>
        </div>

        <modal-dialog v-show="showDialog" :title="modalTitle" :entity="entityObj" :btnclose="btnClose" :btnsubmit="btnSubmit">
            <div slot="modal-body">

                <form id="form1">
                    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
                        <div style=" margin-right: 30px;">
                            <table class="form">

                                <tr>
                                    <td class="formTitle">名称</td>
                                    <td class="formValue">
                                        <input id="menuName" name="menuName" type="text" class="form-control required" v-model="entityObj.Name" />
                                    </td>

                                </tr>
                                <tr>
                                    <td class="formTitle">父菜单</td>
                                    <td class="formValue">
                                        <select id="parentMenuId" name="parentMenuId" class="form-control" v-model="entityObj.ParentId">
                                          </select>
                                        @*<input id="parentMenuId" name="parentMenuId" type="text" class="form-control" v-model="entityObj.ParentId" />*@
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">Url地址</td>
                                    <td class="formValue">
                                        <input id="menuUrl" name="menuUrl" type="text" class="form-control " v-model="entityObj.Url" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">图标</td>
                                    <td class="formValue">
                                        <input id="icon" name="icon" type="hidden" class="form-control" v-model="entityObj.Icon" />
                                        <i v-bind:class="entityObj.Icon"></i>
                                        @*<button class="btn btn-default" onclick="openSelectIcon();"><i class="fa fa-plus"></i>@SharedLocalizer["SelectIcon"]</button>*@
                                        <!--bootstrap模态框 里面用<button>点击事件有问题，执行后会刷新页面,layer弹出层失败-->
                                        <a href="javascript:void(0)" class="btn btn-default" onclick="_vmBase.openSelectIconWin();"><i class="fa fa-plus"></i>@SharedLocalizer["SelectIcon"]</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">序号</td>
                                    <td class="formValue">
                                        <input type="number" id="SortIndex" name="SortIndex" class="form-control required" v-model="entityObj.SortIndex" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">状态</td>
                                    <td class="formValue">
                                        <input type="radio" id="one" value="true" v-model="entityObj.Status">
                                        <label for="one">启用</label>
                                        <input type="radio" id="two" value="false" v-model="entityObj.Status">
                                        <label for="two">禁用</label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">描述</td>
                                    <td class="formValue">
                                        <input id="description" name="description" type="text" class="form-control " v-model="entityObj.Description" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </form>
            </div>

        </modal-dialog>



        <!--选择按钮-->
        @Html.Partial("_Partical_Icon")


    </div>

</div>



@this.RefScript("~/content/js/base.js")
<script type="text/javascript">

    var _getTableListUrl = "@this.Href("~/Menu/Menus")";
    var _updateModelUrl = "@this.Href("~/Menu/Add")";
    var _deleteModelUrl = "@this.Href("~/Menu/Delete")";
    var _enabledUrl = "@this.Href("~/Menu/EnableMenu")";
    var _disabledUrl = "@this.Href("~/Menu/DisAbleMenu")";
    var _getMenuParentSelUrl = "@this.Href("~/Menu/GetMenuSelects")";
    var _getMenuTreeUrl = "@this.Href("~/Menu/GetMenuTree")";

    var _deleteRemand = "@SharedLocalizer["DeleteConfirm"]";
    var _enabledStr = "@SharedLocalizer["Enabled"]";
    var _disabledStr = "@SharedLocalizer["Disabled"]";
    
    
    var _layerIndex;
    

</script> 
<script src="~/js/Views/Menu/Index.js"></script>

